package routes

import (
	"goravel/app/http/controllers"

	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/facades"
	"github.com/goravel/framework/support"
)

func Web() {

	facades.Route().StaticFile("favicon.ico", "./public/favicon.ico")
	facades.Route().StaticFile("favicon-96x96.png", "./public/favicon-96x96.png")
	facades.Route().StaticFile("favicon.svg", "./public/favicon.svg")
	facades.Route().Static("/public", "./public")

	facades.Route().Get("/", func(ctx http.Context) http.Response {
		return ctx.Response().View().Make("welcome.tmpl", map[string]any{
			"version": support.Version,
		})
	})

	facades.Route().Resource("source_databases", &controllers.SourceDatabaseController{})
}
